--- sbin/dhclient/options.c.orig
+++ sbin/dhclient/options.c
@@ -298,6 +298,8 @@
 
 			pointed_len = find_search_domain_name_len(option,
 			    &pointer);
+			if (pointed_len < 0)
+				return (-1);
 			domain_name_len += pointed_len;
 
 			*offset = i + 2;
